package com.glorystone.director;

import com.glorystone.dto.User;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Created by admin on 2017/6/30.
 */
@Component
@RabbitListener(queues = "hello")
public class Consumer_Sub {
    //使用监听的方式消费
    @RabbitHandler
    public void process(String hello) {
        System.out.println("Receiver  : " + hello);
    }

    @RabbitHandler
    public void process(User user){
        System.out.println("Receiver  : " + user.toString());
    }

}
